package com.hashbee.bbs.controller;

import com.hashbee.bbs.domain.Forum;
import com.hashbee.bbs.service.ForumService;
import com.hashbee.bo.ReturnData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/bbs/post/forum")
public class ForumController {

    private static final Logger logger = LoggerFactory.getLogger(ForumController.class);

    @Autowired
    private ForumService forumService;

    @GetMapping("/list")
    public ReturnData list() {
        ReturnData<List<Forum>> returnData = new ReturnData<>();
        returnData.setData(forumService.queryList());
        return returnData;
    }

}
